﻿<Toast:BaseToastControl x:Class="ScrumTable.UI.View.WinTouch.UserControls.Tool.Toast.ErrorToast"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View" xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls"
    xmlns:Toast="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls.Tool.Toast">
    <Toast:BaseToastControl.Resources>
        <Converter:ConverterLocalization x:Key="ConverterLoc" PreText="Error_Field_"/>

        <DataTemplate x:Key="ItemTemplate">
            <ContentControl IsTabStop="False" Margin="0,0,0,9" Background="Transparent" MouseDown="OnItemActivateMouseDown" TouchDown="OnItemActivateTouchDown">
                <Border BorderThickness="2" BorderBrush="#FFC4807F" Padding="9" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" HorizontalAlignment="Stretch">
                    <TextBlock Style="{StaticResource ResourceKey=NormalTextBlock}" Foreground="White" TextTrimming="WordEllipsis"  TextWrapping="Wrap" HorizontalAlignment="Stretch" Height="36" TextAlignment="Left">
                      <TextBlock.Text>
                        <MultiBinding StringFormat="Item # {0}: {1}" >
                            <MultiBinding.Bindings>
                                <Binding Path="BackEndId"/>
                                <Binding Path="Name"/>
                            </MultiBinding.Bindings>                                                                            
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                </Border>
            </ContentControl>
        </DataTemplate>
        
    </Toast:BaseToastControl.Resources>
    <Border BorderThickness="2" BorderBrush="#FFB03C3D" Margin="0,0,0,18" >        
        <Grid Background="#FF9B1111">
            <Grid.RowDefinitions>
                <RowDefinition Height="90" MinHeight="90" x:Name="FirstRow"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Margin="18,13,0,0" Foreground="White" TextAlignment="Left" VerticalAlignment="Top" HorizontalAlignment="Left" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Style="{StaticResource ResourceKey=NormalTextBlock}" >
                <TextBlock.Text>
                        <Localization:Translate Default="[Synchronization problem detected]" Uid="Error_Synch_text">
                            <Binding Path="TitleKey" Converter="{StaticResource ConverterLoc}" StringFormat="[Synchronization problem detected]: {0}" />
                        </Localization:Translate>                                    
                </TextBlock.Text>
            </TextBlock>
            <UserControl Background="Transparent" PreviewMouseDown="OnItemMouseDown" PreviewTouchDown="OnItemTouchDown" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
            <UserControl Grid.Column="1" Margin="0,0,18,18" Background="{StaticResource W8IconWarning}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="32" Height="27"/>

            <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Margin="18" Name="AffectedItems" Visibility="Collapsed" HorizontalAlignment="Stretch">
                <TextBlock Text="{Localization:Translate Uid=Error_Synch_AffectedItems,Default=[Affected Items]}" Style="{StaticResource ResourceKey=NormalTextBlock}" Foreground="White" Margin="0,0,0,9" />
                <ItemsControl  ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Visible" Background="Transparent" ItemsSource="{Binding Content}"  ItemTemplate="{StaticResource ItemTemplate}"/>
            </StackPanel>
        </Grid>
    </Border>
</Toast:BaseToastControl>
